package com.tutk.P2PCam264;

import android.app.Activity;
import android.app.ProgressDialog;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.widget.MediaController;
import android.widget.VideoView;

import com.tutk.agza.NotifyInfo;

import cn.innosmart.aq.R;

/**
 * Created by huanlinchen on 17/12/2015.
 */
public class AgzaMediaPlay extends Activity {
    String VedioURL = "http://mediadownloads.mlb.com/mlbam/2009/05/09/mlbtv_tbabos_4494731_1m.mp4";
    String VedioURL1 = "https://tpnsuploadedfile.s3.amazonaws.com/Z7NXUWYU6GFN85PXPZGJLTElDRXNTtdFqQEBRWsXoHcpBDlrVX?Signature=ues9XH5KiIOx3FS%2BvmzrHgeYa1E%3D&Expires=1450685074&AWSAccessKeyId=AKIAJHTAL5ZENSSP36SA";

    VideoView mVideoView;
    ProgressDialog progressDialog;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.agza_mediaplay);
            NotifyInfo notifyInfo = new NotifyInfo();
            mVideoView = (VideoView)findViewById(R.id.videoView);

            progressDialog = ProgressDialog.show(AgzaMediaPlay.this,"","Loading Vedio wait...", true);

            MediaController mediaController = new MediaController(AgzaMediaPlay.this);
            mediaController.setAnchorView(mVideoView);
            mVideoView.setMediaController(mediaController);
            mVideoView.setVideoPath(VedioURL1);
            mVideoView.requestFocus();
            mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mediaplayer) {
                    progressDialog.dismiss();
                    mVideoView.start();
                    Log.d("MEDIA","STARTVIDEO");
                }
            });


        }






    }


